<%-- 
    Document   : viewactiveuser
    Created on : 03/10/2011, 10:18:11 PM
    Author     : Lan YE 42239015
    Description: A page displaying all active users for a poll.

--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="../header.jsp" %>

<div id="content-container">
    <div id="content">    
        <%if (request.getParameter("pollID") != null) {%>
        <h3 align ="center">List of Active Users</h3>
        <c:choose>   
            <c:when test="${not empty users}">
                <div id="tablecontainer">
                    <table class="gentable" cellpadding="3">
                        <tr>
                            <th>UserID</th>
                            <th>UserName</th>
                            <th>Message</th>

                        </tr>
                        <c:forEach items="${users}" var="activeusers">
                            <tr>
                                <td align ="center"><c:out value="${activeusers.getUserID()}"/></td>
                                <td align ="center"><c:out value="${activeusers.getUsername()}"/></td>
                                <td align ="center"><a href='<c:url value="message.jsp?userID=${activeusers.getUserID()}"/>'>Here</a></td>

                            </tr>
                        </c:forEach>
                    </table>
                </c:when>
                <c:otherwise>
                    <p>There is no active user in this poll.</p>
                </c:otherwise>
            </c:choose>
            <% } else
                    out.println("<p>The page is improperally formed, go back and try again.</p>");
            %>
        </div>

    </div>
